<?php
namespace app\admin\model;
use think\Model;
use think\Db;

class TopicsModel extends Model{
    /*
     *话题列表查询
     */
    public function selectAll()
    {

        $res = Db::table('topics')
            ->where('is_del', 0)
            ->paginate(10);
        return $res;
    }
    /*
     *逻辑删除
     */
    public function deleteRow($data){
        $is_del['is_del'] = 1;
        $res = Db::table('topics')->where("id=$data")->update($is_del);
        return $res;
    }

    /*
     *批量删除
     */
    public function deleteAll($id)
    {
        $res = Db::table('topics')->where('id', $id)->update(['is_del' => 1]);
        return $res;
    }


}